function [entrant, lambda_e, equity_mat, debt_mat, lambda_mat, coupon_mat, optimal_firm, optimal_coupon, C] = entrant_value(bParams,oParams,setts,upMat,f)
% Calculates the entrant's value given f

% Variables:
% bParams,oParams,setts		see readme
% upMat	updating matrix equity value
% f		rate of creative destruction

% Set parameters
	options = setts.options;

% Solve equity value
	[equity_mat, debt_mat, lambda_mat, coupon_mat, optimal_firm, optimal_coupon, C] = equity_value_coupon(bParams,oParams,setts,upMat,f);

% Optimization constraints
	A = [-1];
	b = [0];
	F = @(x) -OPT_E(bParams,oParams,x,optimal_firm);
	res = fmincon(F,[0.5],A,b,[],[],[],[],[],options);
	lambda_e = res;
	entrant = OPT_E(bParams,oParams,res,optimal_firm);

end